﻿<controls:ChildWindow x:Class="AdventureWorksLT.Views.Customers.ChildWindows.SalesOrderDetailCW"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
mc:Ignorable="d"
Title="SalesOrderDetailEditWindow"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:appControls="clr-namespace:AdventureWorksLT.Controls"
xmlns:viewModels="clr-namespace:AdventureWorksLT.Views.Customers.ViewModels">
<!--9 Fields --> 
    <controls:ChildWindow.Resources>
        <viewModels:SalesOrderDetailsViewModel x:Key="SalesOrderDetailsViewModel"></viewModels:SalesOrderDetailsViewModel>
    </controls:ChildWindow.Resources>
    <appControls:BusyIndicator x:Name="BusyIndicator" BusyContent="Loading Patients data...." DataContext="{Binding Source={StaticResource SalesOrderDetailsViewModel}}" Foreground="SlateGray" IsBusy="{Binding IsBusy}">
<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SalesOrderDetailsViewModel}}" Background="WhiteSmoke" >
        <Border BorderBrush="#FF505050"  BorderThickness="2"  CornerRadius="10">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#EDD1DE86" Offset="0.8" />
                    <GradientStop Color="AliceBlue" Offset="1.09" />
                </LinearGradientBrush>
          </Border.Background>
<ScrollViewer x:Name="scrollViewerSalesOrderDetail" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
<Grid HorizontalAlignment="Left" x:Name="SalesOrderDetailGrid" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="32" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
    <ColumnDefinition Width="30" />
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="Auto" />
	<ColumnDefinition Width="50" />
	<ColumnDefinition Width="Auto" />
	<ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>


<StackPanel Grid.Column="1" Grid.Row="1" Orientation="vertical"  >
<TextBlock Height="20" Margin="0,5" ToolTipService.ToolTip="Sales Order Detail Id" ToolTipService.Placement="Right" Text="Sales Order Detail Id:"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" /><TextBlock Height="20" ToolTipService.ToolTip="Sales Order Id" ToolTipService.Placement="Right" Text="Sales Order Id:"  Margin="0,5"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Order Qty" ToolTipService.Placement="Right" Text="Order Qty:"  Margin="0,5" Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Product Id" ToolTipService.Placement="Right" Text="Product Id:"  Margin="0,5"  Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Unit Price" ToolTipService.Placement="Right" Text="Unit Price:"  Margin="0,5" Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Unit Price Discount" ToolTipService.Placement="Right" Text="Unit Price Discount:"  Margin="0,5" Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Line Total" ToolTipService.Placement="Right" Text="Line Total:"  Margin="0,5" Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Rowguid" ToolTipService.Placement="Right" Text="Rowguid:"  Margin="0,5" Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />
<TextBlock Height="20" ToolTipService.ToolTip="Modified Date" ToolTipService.Placement="Right" Text="Modified Date:"  Margin="0,5" Foreground="#FF7635FC" FontWeight="Bold"  Width="180" TextWrapping="Wrap" FontFamily="Portable User Interface" FontSize="11" TextTrimming="None" />

</StackPanel>
<StackPanel Grid.Column="2" Grid.Row="1" Orientation="vertical"  >
<TextBlock  Height="26" HorizontalAlignment="Left" Margin="2" x:Name="SalesOrderDetailIDTextBox" Text="{Binding Path=CurrentSalesOrderDetails.SalesOrderDetailID, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" /><TextBlock  Height="26" HorizontalAlignment="Left" Margin="2" x:Name="SalesOrderIDTextBox" Text="{Binding Path=SalesOrderID, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120"  />
<TextBox ToolTipService.ToolTip="Order Qty" ToolTipService.Placement="Right" Height="26" HorizontalAlignment="Left" Margin="2" x:Name="OrderQtyTextBox" Text="{Binding Path=CurrentSalesOrderDetails.OrderQty, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" HorizontalContentAlignment="Left"  Background="#FFFFFFDC" />
<TextBlock  Height="26" HorizontalAlignment="Left" Margin="2" x:Name="ProductIDTextBox" Text="{Binding Path=CurrentSalesOrderDetails.ProductID, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" Visibility="Collapsed" />
<ComboBox ToolTipService.ToolTip="Product Id" ToolTipService.Placement="Right" Height="26" Margin="2" x:Name="ProductIDComboBox" ItemsSource="{Binding ProductCollection, Mode=TwoWay}" DisplayMemberPath = "Name" SelectedItem="{Binding SelectedProduct, Mode=TwoWay}" VerticalAlignment="Top" Width="150" >
<ComboBox.BorderBrush>
<SolidColorBrush Color="GreenYellow"/>
</ComboBox.BorderBrush>
</ComboBox>
<TextBox ToolTipService.ToolTip="Unit Price" ToolTipService.Placement="Right" Height="26" HorizontalAlignment="Left" Margin="2" x:Name="UnitPriceTextBox" Text="{Binding Path=CurrentSalesOrderDetails.UnitPrice, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" HorizontalContentAlignment="Left"  Background="#FFFFFFDC" />
<TextBox ToolTipService.ToolTip="Unit Price Discount" ToolTipService.Placement="Right" Height="26" HorizontalAlignment="Left" Margin="2" x:Name="UnitPriceDiscountTextBox" Text="{Binding Path=CurrentSalesOrderDetails.UnitPriceDiscount, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" HorizontalContentAlignment="Left"  Background="#FFFFFFDC" />
<TextBox ToolTipService.ToolTip="Line Total" ToolTipService.Placement="Right" Height="26" HorizontalAlignment="Left" Margin="2" x:Name="LineTotalTextBox" Text="{Binding Path=CurrentSalesOrderDetails.LineTotal, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" HorizontalContentAlignment="Left"  Background="#FFFFFFDC" />
<TextBox ToolTipService.ToolTip="Rowguid" ToolTipService.Placement="Right" Height="26" HorizontalAlignment="Left" Margin="2" x:Name="rowguidTextBox" Text="{Binding Path=CurrentSalesOrderDetails.rowguid, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" HorizontalContentAlignment="Left"  Background="#FFFFFFDC" />
<sdk:DatePicker ToolTipService.ToolTip="Modified Date" ToolTipService.Placement="Right"  Height="26" HorizontalAlignment="Left" Margin="2" x:Name="ModifiedDateDatePicker" SelectedDate="{Binding Path=CurrentSalesOrderDetails.ModifiedDate, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" HorizontalContentAlignment="Left" />

</StackPanel>
                        <StackPanel Margin="0,10" Grid.Column="0" Grid.Row="2" Orientation="Horizontal"  Grid.ColumnSpan="3">
                            <Button Margin="20,0,0,0" Style="{StaticResource GreenButton}" x:Name="CancelButton" Content="Cancel"  Background="Blue" Width="75" Height="23" HorizontalAlignment="Right"  />
                            <Button Margin="20,0,0,0" Style="{StaticResource OrangeButton}" x:Name="SaveButton" Content="Save" Background="Green" Width="75" Height="23" HorizontalAlignment="Right" Command="{Binding SaveSalesOrderDetailsCommand}" />
                        </StackPanel>
    
    
      
        </Grid>
        </ScrollViewer>
        </Border>
    </Grid>
    </appControls:BusyIndicator>
</controls:ChildWindow>
